package sample;

import javafx.geometry.Insets;
import javafx.scene.canvas.Canvas;
import javafx.scene.control.Label;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;


public class SecondAnchorPane {
    public AnchorPane SecondAnchorPane() throws Exception{
        AnchorPane anchorPane = new AnchorPane();
        String relativePath = BeautyMain.themeURL+"\\vivo\\vigour_window_bg_dark.9.png";
        Canvas imageView =   BlackBorder.get9NewImageCanvas(relativePath,1080,1920);

        TopPart topPart = new TopPart();

        anchorPane.getChildren().addAll(imageView,topPart.anchorPaneTopPart(),CenterAndBottom());
        anchorPane.setMaxWidth(480);
        anchorPane.setPrefWidth(480);
        anchorPane.setMinWidth(480);
        return  anchorPane;

    }
    //中部和底部
    public AnchorPane CenterAndBottom()throws Exception{
        AnchorPane hBox = new AnchorPane();
        HBox hBox1 = new HBox();
        hBox1.getChildren().add(BottomPart());
        hBox1.setPadding(new Insets(780,0,0,0));
        hBox.getChildren().addAll(SmartDialling(),Dial(),hBox1);
        hBox.setMinWidth(480);
        hBox.setMaxWidth(480);
        hBox.setPrefWidth(480);
        return hBox;
    }
    //智能拨号
    public HBox SmartDialling(){
        HBox hBox = new HBox();
        String relativePath = BeautyMain.themeURL+"\\com.android.contacts\\bbk_smart_dialer_tips.png";
        Canvas imageView =   BlackBorder.get9NewImageCanvas(relativePath,1080,1920);
        hBox.getChildren().addAll(imageView);
        hBox.setMinWidth(480);
        hBox.setMaxWidth(480);
        hBox.setPrefWidth(480);
        return hBox;
    }
    //拨号盘
    public HBox Dial(){

        HBox hBox = new HBox();
        String relativePath = BeautyMain.themeURL+"\\com.android.contacts\\bbk_dialpad_background.png";
        Canvas imageView =   BlackBorder.get9NewImageCanvas(relativePath,1080,612);
        hBox.getChildren().addAll(imageView);
        hBox.setPadding(new Insets(509,0,0,0));
        hBox.setMinWidth(480);
        hBox.setMaxWidth(480);
        hBox.setPrefWidth(480);
        return hBox;
    }

    public  HBox BottomPart(){
        HBox hBox = new HBox();
        VBox left = new VBox();
        String relativePath = BeautyMain.themeURL+"\\com.android.dialer\\bbk_dialer_to_contact.png";
        Canvas imageView =   BlackBorder.get9NewImageCanvas(relativePath,128,128);
        left.getChildren().addAll(imageView);
        left.setPadding(new Insets(0,0,0,50));

        VBox center = new VBox();
        String relativePath1 = BeautyMain.themeURL+"\\com.android.dialer\\bbk_dialer_call.png";
        Canvas imageView1 =   BlackBorder.get9NewImageCanvas(relativePath1,361,132);
        center.getChildren().addAll(imageView1);
        center.setPadding(new Insets(0,0,0,-15));


        VBox right = new VBox();
        String relativePath2 = BeautyMain.themeURL+"\\com.android.dialer\\bbk_dialer_del.png";
        Canvas imageView2 =   BlackBorder.get9NewImageCanvas(relativePath2,128,128);
        right.getChildren().addAll(imageView2);
        right.setPadding(new Insets(0,0,0,-155));

        hBox.getChildren().addAll(left,center,right);
        hBox.setMinWidth(480);
        hBox.setMaxWidth(480);
        hBox.setPrefWidth(480);
        return hBox;
    }


}
